package com.gupaoedu.task.pattern.observer.guavatask;

import com.google.common.eventbus.Subscribe;

/**
 * @author djl
 * @Title: GuavaEvent
 * @Description: TODO
 * @date 2019/3/31
 */
public class GuavaEvent {

    private String name = "GPer生态圈";
    private static GuavaEvent gper = null;
    private GuavaEvent(){}

    public static GuavaEvent getInstance(){
        if(null == gper){
            gper = new GuavaEvent();
        }
        return gper;
    }

    public String getName() {
        return name;
    }
    @Subscribe
    public void subscribe(Question question){

        //System.out.println("执行subscribe方法，传入的参数是：" + str);
      System.out.println(question.getUserName() + "在" + this.name + "上提交了一个问题。" );
    }



}
